HAL RCC migration: List of applicable concepts ¶
This section provides information about the HAL RCC applicable concepts, followed by the HAL CRS applicable concepts.
Concepts for RCC ¶
|
Concept |
Description |
|---|---|
|
Replace HAL_RCC_OscConfig with unitary APIs for individual RCC oscillators |
|
|
Replace HAL_RCC_ClockConfig with unitary APIs for clock source configuration |
|
|
This concept applies only STM32 series with a PLL module in the RCC peripheral. |
|
|
New APIs have been introduced to select the peripherals kernel clock source, and the global
|
|
|
All hardware macros have been removed from the HAL RCC driver, and equivalent services are ensured through the LL APIs. |
|
|
All TypeDef parts of the HAL RCC driver have been removed and replaced by
|
|
|
Const keywords have been added to non-modifiable pointers to ensure that either the pointer itself or the data it points to cannot be modified. This enhances code safety and readability, prevents unintended modifications, and renders code more robust and maintainable. |
|
|
The
|
|
|
Merge HAL extension files with common ones and remove the EX prefix from APIs. |
Only one HAL RCC header file remains and all macros, define statements, and functions from
|
|
Add HAL PPP Services for Drivers with Handle to Retrieve Corresponding Peripheral Clock Frequency. |
This is not applicable for single instance peripherals across all STM32 series. |
|
Replace Finite Parameter Defines (Including PPP Instances) with Enum Types at HAL Levels. |
Finite parameters (including RCC instances) have been converted into enumerated types (enums) at HAL level. This improves code readability, maintainability, and type safety. |
|
Add HAL_PPP Prefix to All HAL Peripheral APIs (Defines, Macros, Types, and Functions). |
All HAL RCC functions start with
|
Other HAL RCC changes ¶
|
Concept |
Consideration |
|---|---|
|
Remove all the dependencies with FLASH and GPIO HAL driver |
Flash latency should be configured corresponding to the system clock frequency out of RCC APIs. GPIO PIN configuration should be managed in the application when configuration of MCO or LSCO output clock is needed. |
|
Replace force/release function by reset function only |
Add
|
|
Provide peripherals Low Power enabling APIs for specific mode |
Depending on the supported Low Power mode for a peripheral (according to Reference manual RCC and PWR Chapters), provide
|
|
Add APIs to check oscillators enabled & ready states |
Add APIs to check oscillator enabled state
|
Concepts for CRS ¶
|
Concept |
Notes |
|---|---|
|
The HAL CRS is a newly introduced driver. In HAL1, CRS functionality was implemented as a set of functions integrated within the HAL RCC driver. In HAL2, it has been refactored into a dedicated, standalone HAL CRS driver. Therefore, we applied the following concept:
The
|
|
|
Removal and conversion of init structure to configuration structure |
The initialization structure has been removed and moved into
|
|
New APIs are available to set and get CRS features. |
|
|
Add HAL User Data Set/Get APIs:
|
|
|
HAL RCC APIs now rely on LL APIs rather than performing direct register access. |
|
|
Define statements and enumerations redirected to LL equivalents |
HAL RCC define statements and enumerations are based on LL define statements. |
|
All hardware macros have been removed from the HAL RCC driver, and equivalent services are ensured through the LL APIs. |
|
|
Update HAL CRS functions to return:
|
|
|
Redesign the error handling mechanisms within the HAL to improve the detection, reporting, and handling of errors. |
|
|
All TypeDef parts of the HAL RCC driver have been removed and replaced by
|
|
|
Const keywords have been added to non-modifiable pointers to ensure that either the pointer itself or the data it points to cannot be modified. This enhances code safety and readability, prevents unintended modifications, and renders code more robust and maintainable. |
|
|
The parameters and state are checked using
|
|
|
No
|
|
|
Replace Finite Parameter Defines (Including PPP Instances) with Enum Types at HAL Levels. |
Finite parameters (including RCC instances) have been converted into enumerated types (enums) at HAL level. This improves code readability, maintainability, and type safety. |
|
Add HAL_PPP Prefix to All HAL Peripheral APIs (Defines, Macros, Types, and Functions). |
All HAL CRS functions start with
|
Other HAL CRS changes ¶
|
Concept |
Consideration |
|---|---|
|
Provide a standalone HAL CRS driver applying the generic HAL2 architecture rules. |
For more details, please refer to: Concepts for CRS. |